import java.sql.SQLOutput;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2024-03-13
 * Time: 14:22
 */
public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree=new BinaryTree();
        BinaryTree.TreeNode root=   binaryTree.createTree();
        System.out.print("前序遍历:");

        binaryTree.preOrder(root);
        System.out.println();
        System.out.print("中序遍历:");
        binaryTree.inOrder(root);
        System.out.println();
        System.out.print("后序遍历:");

        binaryTree.postOrder(root);
        System.out.println();
        binaryTree.size(root);
        System.out.println("节点个数:");
        System.out.println(BinaryTree.nodeSize);
        System.out.println(binaryTree.size2(root));
        System.out.println("叶子节点个数:");
        binaryTree.getLeafNodeCount1(root);
        System.out.println(BinaryTree.leafSize);
        System.out.println(binaryTree
                .getLeafNodeCount2(root));
        System.out.println("第3层节点个数:");

        System.out.println(binaryTree.getKLevelNodeCount(root, 3));
        System.out.println("树的高度;");
        System.out.println(binaryTree.getHeight(root));
        BinaryTree.TreeNode node=binaryTree.find(root,'C');
        System.out.println(node.val);
        System.out.println("================");
        System.out.println(binaryTree.isCompleteTree(root));




    }

}
